import { HttpClient } from "../../../../service/Http/HttpClient";
// import fly from "../../../../service/Http/fly";

//****开始用户****
//分页查找用户
export const getUserFind = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/user/find", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//获取项目所有部门
export const getfindAllDepartment = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/findAll", {
    method: "POST",
    headers: {},
  });
};
//新增用户
export const addUser = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/user/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除用户
export const deleteUser = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/user/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑用户
export const updateUser = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/user/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//****结束用户****
//****开始角色****
//获取项目所有角色
export const getfindAllRole = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/findAll", {
    method: "POST",
    headers: {},
  });
  // return fly.post("/api/system/role/findAll");
};
//新增角色
export const AddRole = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑角色
export const EditRole = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//绑定角色菜单授权
export const BindRoleMenu = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/configMenu", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//查询角色菜单
export const getRoleMenus = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/getRoleMenus", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除角色菜单
export const DeleteRole = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/role/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//****结束角色****
//****开始菜单****
//获取项目所有菜单
export const getfindAllMenu = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/findAllMenu", {
    method: "POST",
    headers: {},
  });
  // return fly.post("/api/system/menu/findAllMenu");
};
//获取用户授权菜单
export const getUserMenus = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/getUserMenus", {
    method: "POST",
    headers: {},
  });
  // return fly.post("/api/system/menu/getUserMenus");
};
//删除菜单
export const deleteMenu = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
  // return fly.post("/api/system/menu/delete", pream);
};
//新增菜单
export const addMenu = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
  // return fly.post("/api/system/menu/add", pream);
};
//修改菜单
export const updateMenu = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
  // return fly.post("/api/system/menu/add", pream);
};
///system/menu/findParentSysMenu
export const findParentSysMenu = () => {
  // return fly.post("/api/system/menu/findParentSysMenu");
  const http = HttpClient.instance();
  return http.fetch("/api/system/menu/findParentSysMenu", {
    method: "POST",
    headers: {},
  });
};
//****结束菜单****
